package com.hsj.mq.rabbitmq.direct;


import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Active 自动从 消息队列里面 拿到消息并消费
 */
//@Component
public class ListenFromRabbitMQ {
//如果是多个监听器 会轮询进行处理
    @RabbitListener(queues = "direct_queue")
    public String antoReceive(String id){
        System.out.println("接受到rabbit mq direct 消息队列的消息，消费"+id);
        return "insert"+id;
    }
}
